//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <iostream>

#include "ProcessCathFASTAProfile.h"
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
using namespace std;
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
int main (int argc, char** argv) {
  
  String* namefileFASTAProfile = NULL;
  String* namefileOut          = NULL;

  if (argc < 3) {
    
    cout << "Error in the input parameters! Must by like: " << endl;
    cout << "./GetFrequencyOfResidues <In File - CATH FASTA Profile>";
    cout <<                         " <Out File>";
    cout << endl;
    
    return 0;
    
  }
  else {
    
    namefileFASTAProfile = new String(argv[1]);
    namefileOut          = new String(argv[2]);
    
    cout << "---------------------------------------------------------------------------------" << endl;
    cout << " In File - Ligand FASTA Profile : " << argv[1] << endl;
    cout << "                       Out File : " << argv[2] << endl;
    cout << "---------------------------------------------------------------------------------" << endl;
    
  }
  
  ProcessCathFASTAProfile* processCathFASTAProfile = new ProcessCathFASTAProfile ();
  
  cout << "Preparing Files..." << endl;
  processCathFASTAProfile->NamefileIn(namefileFASTAProfile);
  processCathFASTAProfile->NamefileOut(namefileOut);
  
  cout << "Loading Profile FASTA File..." << endl;
  processCathFASTAProfile->LoadData();
  
  cout << "Computing the frequency of length..." << endl;
  processCathFASTAProfile->GetDistributionOfLength();
  
  cout << "Finished..." << endl << "Good Bye" << endl;
  
  if (processCathFASTAProfile) delete processCathFASTAProfile;
  if (namefileFASTAProfile)    delete namefileFASTAProfile;
  if (namefileOut)             delete namefileOut;

  return EXIT_SUCCESS;
  
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//

